<template>
  <page-card :title="menuName">
    <!-- 头部栏位 -->
    <a-row style="margin-bottom: 20px">
      <!-- 添加按钮 -->
      <a-col :span="12">
        <a-button v-if="hasPermission('add')" type="primary" @click="$emit('add')">新增</a-button>
      </a-col>
      <!-- 空行 -->
      <a-col :span="8"></a-col>
      <!-- 搜索框 -->
      <a-col :span="4">
        <a-input-search :placeholder="`${$parent.MJText}名称`"
                            v-model="searchName"
                            @change="e => $emit('change', searchName)"
                            @search="e => $emit('search', e)"
                            style="min-width:200px;width: 100%"
                            allow-clear />
      </a-col>
    </a-row>
    <!-- table -->
    <slot></slot>
  </page-card>
</template>

<script>

export default {
  // mj管理公共代码 
  name: 'Secrety',
  // props: {
  //   syProperties: {
  //     type: Object,
  //     default: () => {}
  //   }
  // },
  data(){
    return {
      searchName: undefined
    }
  },
  computed:{
    // 菜单名字
    menuName(){
      return this.$route.meta.title || this.$route.name
    }
  }
}
</script>

<style lang="less" scoped>
</style>